<template>
   <div id="app">
      我是首页  <br />
      {{str1}}
      <button @click="btn">点击</button>
   </div>
</template>
<script setup>
import {computed} from 'vue'
import {useStore} from 'vuex'
let store = useStore()
console.log(1,store)
console.log(2,store.state.user.str1)
let str1 = computed(()=>store.state.user.str1)
const btn = ()=>{
    store.commit('changeStr1')
}
</script>
<style>
</style>


 
 
